package com.cadre.common.utils.oldutil;

import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr;

import java.util.Map;
import java.util.regex.Pattern;

/* loaded from: CellHandler.class */
public interface CellHandler {
    void setValue(XWPFParagraph xWPFParagraph, Map map);

    static CTPPr getParagraphCTPPr(XWPFParagraph paragraph) {
        CTPPr pPPr = null;
        if (paragraph.getCTP() != null) {
            if (paragraph.getCTP().getPPr() != null) {
                pPPr = paragraph.getCTP().getPPr();
            } else {
                pPPr = paragraph.getCTP().addNewPPr();
            }
        }
        return pPPr;
    }

    static String[] splitText(String str) {
        return (str == null || "".equals(str)) ? new String[]{""} : Pattern.compile("(\r\n)|\r|\n").matcher(str).replaceAll("☀").split("☀");
    }
}
